package cn.com.code.hwjs;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * 简单密码
 * https://www.nowcoder.com/practice/7960b5038a2142a18e27e4c733855dac?tpId=37&tqId=21244&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D37&difficulty=undefined&judgeStatus=undefined&tags=&title=
 *
 * @author zhengpei
 * @date 2022/5/15
 */
public class Hwjs21 {

  private static Map<String, String> map = new HashMap<>();

  static {
    map.put("1", "1");
    map.put("abc", "2");
    map.put("def", "3");
    map.put("ghi", "4");
    map.put("jkl", "5");
    map.put("mno", "6");
    map.put("pqrs", "7");
    map.put("tuv", "8");
    map.put("wxyz", "9");
    map.put("0", "0");
  }

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    while (sc.hasNext()) {
      String str = sc.nextLine();
      char[] chars = str.toCharArray();
      StringBuilder  builder = new StringBuilder();
      for (char c : chars) {
        if (c >= 'A' && c <= 'Y') {
          char newChar = (char) (c - 'A' + 'a' + 1);
          builder.append(newChar);
        } else if (c >= '0' && c <= '9') {
          builder.append(c);
        } else if (c == 'Z') {
          builder.append('a');
        } else {

          for (String key : map.keySet()) {
            if (key.contains(String.valueOf(c))) {
              String s = map.get(key);
              builder.append(s);
            }
          }
        }
      }

      System.out.println(builder.toString());

    }

  }

}
